using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class tbs_MissingPKeysMap : EntityTypeConfiguration<tbs_MissingPKeys>
    {
        public tbs_MissingPKeysMap()
        {
            // Primary Key
            this.HasKey(t => new { t.name, t.id, t.xtype, t.uid, t.info, t.status, t.base_schema_ver, t.replinfo, t.parent_obj, t.crdate, t.ftcatid, t.schema_ver, t.stats_schema_ver });

            // Properties
            this.Property(t => t.name)
                .IsRequired()
                .HasMaxLength(128);

            this.Property(t => t.id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.xtype)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.uid)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.info)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.status)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.base_schema_ver)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.replinfo)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.parent_obj)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.ftcatid)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.schema_ver)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.stats_schema_ver)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.type)
                .IsFixedLength()
                .HasMaxLength(2);

            // Table & Column Mappings
            this.ToTable("tbs_MissingPKeys");
            this.Property(t => t.name).HasColumnName("name");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.xtype).HasColumnName("xtype");
            this.Property(t => t.uid).HasColumnName("uid");
            this.Property(t => t.info).HasColumnName("info");
            this.Property(t => t.status).HasColumnName("status");
            this.Property(t => t.base_schema_ver).HasColumnName("base_schema_ver");
            this.Property(t => t.replinfo).HasColumnName("replinfo");
            this.Property(t => t.parent_obj).HasColumnName("parent_obj");
            this.Property(t => t.crdate).HasColumnName("crdate");
            this.Property(t => t.ftcatid).HasColumnName("ftcatid");
            this.Property(t => t.schema_ver).HasColumnName("schema_ver");
            this.Property(t => t.stats_schema_ver).HasColumnName("stats_schema_ver");
            this.Property(t => t.type).HasColumnName("type");
            this.Property(t => t.userstat).HasColumnName("userstat");
            this.Property(t => t.sysstat).HasColumnName("sysstat");
            this.Property(t => t.indexdel).HasColumnName("indexdel");
            this.Property(t => t.refdate).HasColumnName("refdate");
            this.Property(t => t.version).HasColumnName("version");
            this.Property(t => t.deltrig).HasColumnName("deltrig");
            this.Property(t => t.instrig).HasColumnName("instrig");
            this.Property(t => t.updtrig).HasColumnName("updtrig");
            this.Property(t => t.seltrig).HasColumnName("seltrig");
            this.Property(t => t.category).HasColumnName("category");
            this.Property(t => t.cache).HasColumnName("cache");
        }
    }
}
